<template>
  <div class="user">
    <basic-container>
      <avue-form ref="form" v-model="form" :option="formOption" @submit="handleSubmit"></avue-form>
    </basic-container>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

import { addText, getText } from "@/api/admin/set";


export default {
  data() {
    return {
      formOption: {
        submitText: "完成",
        menuBtn: true,
        column: [
          {
            label: "费率",
            prop:'percent1',
            controls:false,
            type:'number',
            rules: [
              {
                required: true,
                message: "请输入"
              }
            ],
            span: 12,
          }
        ]
      },
      form: {}
    };
  },
  computed: {
    ...mapGetters(["permissions", "access_token"])
  },
  created() {
    this.getContnet()
  },
  methods: {
    getContnet(){
      getText(4).then(res=>{
        this.form = res.data.data
      })
    },
    handleSubmit(form,done){
      addText(Object.assign({id: 4}, this.form)).then(response => {
        this.$message.success('修改成功');
        done()
      });
    }
  }
};
</script>
